package cn.wolfcode.crm.util;

import com.fasterxml.jackson.databind.ObjectMapper;

public abstract class JsonUtil {

    //将Object对象转换成json字符串
    public static String obj2json(Object obj){
        try{
            ObjectMapper objectMapper = new ObjectMapper();
            return objectMapper.writeValueAsString(obj);
        }catch(Exception e){
            throw  new RuntimeException(e);
        }
    }

}
